package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementOspfv3PortNeighbMapper;
import com.ruoyi.net.domain.ElementOspfv3PortNeighb;
import com.ruoyi.net.service.IElementOspfv3PortNeighbService;

/**
 * 网元-OSPFV3接口配置-邻居配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementOspfv3PortNeighbServiceImpl implements IElementOspfv3PortNeighbService 
{
    @Autowired
    private ElementOspfv3PortNeighbMapper elementOspfv3PortNeighbMapper;

    /**
     * 查询网元-OSPFV3接口配置-邻居配置
     * 
     * @param id 网元-OSPFV3接口配置-邻居配置主键
     * @return 网元-OSPFV3接口配置-邻居配置
     */
    @Override
    public ElementOspfv3PortNeighb selectElementOspfv3PortNeighbById(String id)
    {
        return elementOspfv3PortNeighbMapper.selectElementOspfv3PortNeighbById(id);
    }

    /**
     * 查询网元-OSPFV3接口配置-邻居配置列表
     * 
     * @param elementOspfv3PortNeighb 网元-OSPFV3接口配置-邻居配置
     * @return 网元-OSPFV3接口配置-邻居配置
     */
    @Override
    public List<ElementOspfv3PortNeighb> selectElementOspfv3PortNeighbList(ElementOspfv3PortNeighb elementOspfv3PortNeighb)
    {
        return elementOspfv3PortNeighbMapper.selectElementOspfv3PortNeighbList(elementOspfv3PortNeighb);
    }

    /**
     * 新增网元-OSPFV3接口配置-邻居配置
     * 
     * @param elementOspfv3PortNeighb 网元-OSPFV3接口配置-邻居配置
     * @return 结果
     */
    @Override
    public int insertElementOspfv3PortNeighb(ElementOspfv3PortNeighb elementOspfv3PortNeighb)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementOspfv3PortNeighb.getId())) {
            elementOspfv3PortNeighb.setId(uuid);
        }
        elementOspfv3PortNeighb.setCreateBy(SecurityUtils.getUsername());
        elementOspfv3PortNeighb.setCreateTime(DateUtils.getNowDate());
        elementOspfv3PortNeighb.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv3PortNeighb.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv3PortNeighbMapper.insertElementOspfv3PortNeighb(elementOspfv3PortNeighb);
    }

    /**
     * 修改网元-OSPFV3接口配置-邻居配置
     * 
     * @param elementOspfv3PortNeighb 网元-OSPFV3接口配置-邻居配置
     * @return 结果
     */
    @Override
    public int updateElementOspfv3PortNeighb(ElementOspfv3PortNeighb elementOspfv3PortNeighb)
    {
        elementOspfv3PortNeighb.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv3PortNeighb.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv3PortNeighbMapper.updateElementOspfv3PortNeighb(elementOspfv3PortNeighb);
    }

    /**
     * 批量删除网元-OSPFV3接口配置-邻居配置
     * 
     * @param ids 需要删除的网元-OSPFV3接口配置-邻居配置主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv3PortNeighbByIds(String[] ids)
    {
        return elementOspfv3PortNeighbMapper.deleteElementOspfv3PortNeighbByIds(ids);
    }

    /**
     * 删除网元-OSPFV3接口配置-邻居配置信息
     * 
     * @param id 网元-OSPFV3接口配置-邻居配置主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv3PortNeighbById(String id)
    {
        return elementOspfv3PortNeighbMapper.deleteElementOspfv3PortNeighbById(id);
    }
}
